home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / axe.h < prev    next >
C/C++ Source or Header  |  1994-11-19  |  1KB  |  40 lines

  1. #ifndef __AXE_H_
  2. #define __AXE_H_
  3.  
  4. #include "drawtool.h"
  5.  
  6. #include "geom.h"
  7. #include <string.h>
  8.  
  9. //  Incapsulate AXE attributes: length and so on.
  10. //  If you want not use automatic ticks calculation, use start == end
  11. //  and pass array of ticks coordinates.
  12.  
  13.  
  14.  
  15. #define MAXLABELS 40
  16.  
  17. struct Axe
  18.     {
  19.     int len_scr;               // Length on screen, pixels
  20.     int* ticks;                // Ticks offset from axe beginning, pixels
  21.     int* sub_ticks;            // Sub-ticks, -//-
  22.     char** labels;             // Ticks commentaries
  23.     int ticks_no;              // Total number of ticks
  24.     int sub_ticks_no;          // Total number of sub ticks
  25.  
  26.     Axe(int len_on_screen,            double start_of_axe = 0,
  27.      double end_of_axe = 0,        int total_tick_no = 5,
  28.      int* tick_offsets = NULL,     int total_sub_tick_no = 0,
  29.      int* sub_ticks_offset = NULL, char** label_legends = NULL);
  30.  
  31.     ~Axe();
  32.     virtual loc get_label_pos(loc, int )  { return loc(0, 0); }
  33.     virtual void show_axe(loc, int) {};  // No labels
  34.     void draw_axe(loc lt, int, int);     // Show both axe and labels
  35.     virtual void show_labels(loc) {};
  36.     int calc_labels(double start, double end, int t = 5, int s = 0);
  37.     };
  38.  
  39.  
  40. #endif __AXE_H_